<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JSON 格式化工具 Pro</title>
    <link rel="stylesheet" href="styles.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
    <style>
        /* JSON树形结构样式 */
        .json-tree {
            font-family: 'Consolas', monospace;
            font-size: 14px;
            line-height: 1.4;
            color: var(--text-color);
            background-color: var(--card-background);
            padding: 15px;
            border-radius: 4px;
            overflow: auto;
            /* max-height: 500px; */
        }
        
        .json-node {
            margin-left: 20px;
        }
        
        .json-key {
            color: #0451a5;
            font-weight: bold;
        }
        
        [data-theme="dark"] .json-key {
            color: #9cdcfe;
        }
        
        .json-string {
            color: #a31515;
        }
        
        [data-theme="dark"] .json-string {
            color: #ce9178;
        }
        
        .json-number {
            color: #098658;
        }
        
        [data-theme="dark"] .json-number {
            color: #b5cea8;
        }
        
        .json-boolean {
            color: #0000ff;
        }
        
        [data-theme="dark"] .json-boolean {
            color: #569cd6;
        }
        
        .json-null {
            color: #808080;
        }
        
        .toggle-btn {
            background: none;
            border: none;
            color: var(--primary-color);
            cursor: pointer;
            font-size: 14px;
            margin-left: 8px;
            padding: 2px 4px;
            border-radius: 2px;
            transition: background-color 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
        }
        
        .toggle-btn:hover {
            background-color: var(--tip-background);
        }
        
        .toggle-btn::before {
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            content: '\f055'; /* circle-plus */
            font-size: 14.4px;
            /* color: #666; */
            color: rgb(26, 132, 26);
            transition: transform 0.15s ease, opacity 0.1s ease;
            transform: translateZ(0); /* 启用硬件加速 */
            will-change: transform, opacity;
        }
        
        .toggle-btn.expanded::before {
            content: '\f056'; /* circle-minus */
            color: rgb(159, 4, 4);
            transform: translateZ(0) scale(1.05);
        }
        
        .collapsed {
            display: none;
        }
        
        .json-bracket {
            color: var(--text-color);
            font-weight: bold;
        }
        
        .json-comma {
            color: var(--text-color);
        }
        
        .json-line {
            display: flex;
            align-items: flex-start;
        }
        
        .json-content {
            flex: 1;
            contain: layout style; /* CSS containment 优化 */
        }
        
        .json-body {
            transform: translateZ(0); /* 启用硬件加速 */
            will-change: auto;
        }
        
        .json-body.expanding {
            will-change: opacity, transform;
        }
        
        .preserve-escape-checkbox {
            display: flex;
            align-items: center;
            cursor: pointer;
            font-size: 14px;
            color: var(--text-color);
            margin-right: 15px;
            user-select: none;
        }
        
        .preserve-escape-checkbox input[type="checkbox"] {
            display: none;
        }
        
        .preserve-escape-checkbox .checkmark {
            width: 18px;
            height: 18px;
            border: 2px solid var(--border-color);
            border-radius: 3px;
            margin-right: 8px;
            position: relative;
            transition: all 0.3s;
        }
        
        .preserve-escape-checkbox input[type="checkbox"]:checked + .checkmark {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
        
        .preserve-escape-checkbox input[type="checkbox"]:checked + .checkmark::after {
            content: '';
            position: absolute;
            left: 5px;
            top: 2px;
            width: 4px;
            height: 8px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
        
        .preserve-escape-checkbox:hover .checkmark {
            border-color: var(--primary-color);
        }
        
        .tree-controls {
            margin-bottom: 10px;
            display: flex;
            gap: 10px;
        }
    </style>
    <script type="text/javascript" charset="UTF-8" src="https://cdn.wwads.cn/js/makemoney.js" async></script>
</head>
<body>
    <header>
        <div class="header-container">
            <div class="header-left">
                <div class="logo">
                    <span><a href="https://geekdaxue.co/" target="_blank"><img src="https://geekdaxue.co/static/images/logo_platypus.png" height="30px"></a></span>
                </div>
                <nav class="main-navigation">
                    <div class="nav-item dropdown">
                        <a href="#" class="nav-link">
                            JSON工具 <i class="fas fa-chevron-down"></i>
                        </a>
                        <div class="dropdown-menu">
                            <a href="../json/index.html">JSON 格式化</a>
                            <a href="../json/parser.html">JSON 格式校验</a>
                            <a href="../json/excel.html">JSON 转 Excel/CSV</a>
                            <a href="../json/jsonxml.html">JSON 与 XML 转换</a>
                            <a href="../json/editor.html">JSON 编辑器</a>
                            <a href="../json/txt2json_arr.html">文本转JSON数组</a>
                        </div>
                    </div>
                    <div class="nav-item dropdown">
                        <a href="#" class="nav-link">
                            编码转换 <i class="fas fa-chevron-down"></i>
                        </a>
                        <div class="dropdown-menu">
                            <a href="../coding/base64.html">Base64 编码</a>
                            <a href="../coding/urlencoding.html">URL 编码</a>
                            <a href="../coding/md5.html">MD5 加密</a>
                            <a href="../coding/unicode.html">Unicode 转换</a>
                            <a href="../coding/hex_convert.html">进制转换</a>
                            <a href="../coding/xmind2excel.html">Xmind 转 Excel/CSV</a>
                        </div>
                    </div>
                    <div class="nav-item dropdown">
                        <a href="#" class="nav-link">
                            文本工具 <i class="fas fa-chevron-down"></i>
                        </a>
                        <div class="dropdown-menu">
                            <a href="../txt/diff.html">文本对比</a>
                            <a href="../txt/replace.html">文本替换</a>
                            <a href="../txt/remove.html">空白行移除</a>
                            <a href="../txt/cn_trans.html">繁简体转换</a>
                            <a href="../txt/html_format.html">HTML 格式化</a>
                            <a href="../txt/xml_format.html">XML 格式化</a>
                        </div>
                    </div>
                    <div class="nav-item dropdown">
                        <a href="#" class="nav-link">
                            图片工具 <i class="fas fa-chevron-down"></i>
                        </a>
                        <div class="dropdown-menu">
                            <a href="../img/2svg.html">图片转 SVG</a>
                            <a href="../img/qr_code.html">二维码生成</a>
                            <a href="../img/barcode.html">条形码生成</a>
                        </div>
                    </div>
                </nav>
            </div>
            <div class="header-controls">
                <div class="theme-toggle">
                    <input type="checkbox" id="theme-switch" class="theme-switch">
                    <label for="theme-switch" class="theme-switch-label">
                        <i class="fas fa-sun"></i>
                        <i class="fas fa-moon"></i>
                        <span class="slider"></span>
                    </label>
                </div>
                <div class="share-button" id="share-button" title="分享给朋友">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </div>
            </div>
        </div>
    </header>

    <div class="container">
        <h1>JSON 格式化工具</h1>
        <div id="privacy-notice" class="privacy-notice">
            <div class="privacy-notice-content">
                <i class="fas fa-shield-alt"></i>
                <p>安全提示：您的数据仅在本地浏览器中处理，不会上传到服务器，请放心使用！</p>
                <button id="close-notice" class="close-notice" title="关闭提示">
                    <i class="fas fa-times"></i>
                </button>
            </div>
        </div>
        
        <main>
            <div class="editor-container">
                <div class="input-section">
                    <h2>输入 JSON</h2>
                    <textarea id="json-input" placeholder="在此粘贴您的 JSON 数据..."></textarea>
                    <div class="button-group">
                        <button id="format-btn">格式化</button>
                        <button id="clear-btn">清空</button>
                    </div>
                    <div id="error-message" class="error-message"></div>
                </div>
                
                <div class="output-section">
                    <div class="output-header">
                        <h2>格式化结果</h2>
                        <div class="output-buttons">
                            <label class="preserve-escape-checkbox">
                                <input type="checkbox" id="preserve-escape" checked>
                                <span class="checkmark"></span>
                                保留转义
                            </label>
                            <button id="copy-btn" class="copy-btn" title="复制到剪贴板">
                                <i class="fas fa-copy"></i> 复制
                            </button>
                        </div>
                    </div>
                    <div id="json-output" class="json-tree"></div>
                </div>
            </div>
        </main>
        <div class="wwads-cn wwads-horizontal" data-id="321" style="max-width:350px"></div>
    </div>
    <footer>
            <div class="footer-container">
                <div class="footer-main">
                    <div class="footer-section about-us">
                        <h3>关于我们</h3>
                        <p>我们提供一系列高效、便捷的在线工具，帮助开发者、非技术人员提高工作效率，解决日常开发中遇到的各种问题。</p>
                        <p>Build With <i class="fa-solid fa-heart" style="color: red;"></i> For SF.</p>
                    </div>
                    <div class="footer-section links">
                        <h3>工具导航</h3>
                        <div class="links-columns">
                            <ul>
                                <li><a href="../json/index.html">JSON 工具</a></li>
                                <li><a href="../img/index.html">图片处理</a></li>
                                <li><a href="#">开发工具</a></li>
                            </ul>
                            <ul>
                                <li><a href="../coding/index.html">编码转换</a></li>
                                <li><a href="../txt/index.html">文本工具</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="footer-section contact">
                        <h3>联系我们</h3>
                        <div class="social-icons">
                            <a href="#" title="GitHub"><i class="fab fa-github"></i></a>
                            <a href="#" title="Twitter"><i class="fab fa-twitter"></i></a>
                            <a href="#" title="WeChat"><i class="fab fa-weixin"></i></a>
                            <a href="mailto:example@example.com" title="Email"><i class="fas fa-envelope"></i></a>
                        </div>
                        <p>如有问题或建议，请随时联系我们</p>
                    </div>
                </div>
                <div class="footer-bottom">
                    <p>© 2025 JSON 格式化工具 Pro. 保留所有权利</p>
                    <div class="footer-legal">
                        <a href="#">使用条款</a>
                        <a href="#">隐私政策</a>
                    </div>
                </div>
            </div>
        </footer>
    
    <div id="copy-notification" class="copy-notification">已复制到剪贴板！</div>
    <div id="share-notification" class="copy-notification">已复制网址，赶快让更多的小伙伴知道我吧！</div>
    
    <script>
        // 全局切换处理函数 - 高性能优化版本
        function handleToggleClick(buttonElement, type, itemsOrKeys) {
            // 防止重复点击和节流
            if (buttonElement.dataset.processing === 'true') {
                return;
            }
            buttonElement.dataset.processing = 'true';
            
            const isExpanded = buttonElement.getAttribute('data-expanded') === 'true';
            const parentContent = buttonElement.closest('.json-content');
            if (!parentContent) {
                buttonElement.dataset.processing = 'false';
                return;
            }
            
            const targetBody = parentContent.querySelector('.json-body');
            const targetFooter = parentContent.children[parentContent.children.length - 1];
            const targetHeader = parentContent.querySelector('.json-header-text');

            if (!targetBody || !targetFooter || !targetHeader) {
                buttonElement.dataset.processing = 'false';
                return;
            }

            const bracketSpan = targetHeader.querySelector('.json-bracket');

            // 使用双重 requestAnimationFrame 确保流畅动画
            requestAnimationFrame(() => {
                requestAnimationFrame(() => {
                    if (isExpanded) {
                        // 收缩操作 - 批量 DOM 更新
                        targetBody.classList.remove('expanding');
                        targetBody.style.display = 'none';
                        targetFooter.style.display = 'none';
                        buttonElement.classList.remove('expanded');
                        buttonElement.setAttribute('data-expanded', 'false');
                        
                        if (bracketSpan) {
                             const newText = type === 'array' 
                                 ? `Array[${itemsOrKeys}]`
                                 : `Object{...}`;
                             if (!bracketSpan.textContent.includes(type === 'array' ? 'Array' : 'Object{...}')) {
                                 bracketSpan.textContent = newText;
                             }
                         }
                    } else {
                        // 展开操作 - 优化渲染顺序
                        targetBody.classList.add('expanding');
                        buttonElement.classList.add('expanded');
                        buttonElement.setAttribute('data-expanded', 'true');
                        
                        if (bracketSpan) {
                            bracketSpan.textContent = type === 'array' ? '[' : '{';
                        }
                        
                        // 分步显示内容，减少重排
                        targetBody.style.display = 'block';
                        
                        // 延迟显示 footer 以分散渲染负载
                        setTimeout(() => {
                            targetFooter.style.display = 'block';
                            targetBody.classList.remove('expanding');
                        }, 16); // 约一帧的时间
                    }
                    
                    // 重置处理状态
                    setTimeout(() => {
                        buttonElement.dataset.processing = 'false';
                    }, 50); // 防抖延迟
                });
            });
        }

        document.addEventListener('DOMContentLoaded', function() {
            // 获取DOM元素
            const jsonInput = document.getElementById('json-input');
            const jsonOutput = document.getElementById('json-output');
            const formatBtn = document.getElementById('format-btn');
            const clearBtn = document.getElementById('clear-btn');
            const copyBtn = document.getElementById('copy-btn');
            const preserveEscapeCheckbox = document.getElementById('preserve-escape');
            const errorMessage = document.getElementById('error-message');
            const copyNotification = document.getElementById('copy-notification');
            const shareNotification = document.getElementById('share-notification');
            const themeSwitch = document.getElementById('theme-switch');
            const privacyNotice = document.getElementById('privacy-notice');
            const closeNoticeBtn = document.getElementById('close-notice');
            const shareButton = document.getElementById('share-button');
            
            // 检查本地存储中的主题设置
            if (localStorage.getItem('theme') === 'dark') {
                document.documentElement.setAttribute('data-theme', 'dark');
                themeSwitch.checked = true;
            }
            
            // 主题切换功能
            themeSwitch.addEventListener('change', function() {
                if (this.checked) {
                    document.documentElement.setAttribute('data-theme', 'dark');
                    localStorage.setItem('theme', 'dark');
                } else {
                    document.documentElement.removeAttribute('data-theme');
                    localStorage.setItem('theme', 'light');
                }
            });
            
            // 隐私提示框关闭功能
            closeNoticeBtn.addEventListener('click', function() {
                privacyNotice.style.display = 'none';
                localStorage.setItem('privacyNoticeClosed', 'true');
            });
            
            // 检查是否需要显示隐私提示
            if (localStorage.getItem('privacyNoticeClosed') === 'true') {
                privacyNotice.style.display = 'none';
            }
            
            // 分享功能
            shareButton.addEventListener('click', function() {
                const url = window.location.href;
                navigator.clipboard.writeText(url).then(function() {
                    showNotification(shareNotification);
                }).catch(function() {
                    console.error('复制失败');
                });
            });
            


            // 创建JSON树形结构
            function createJsonTree(obj, key = null, level = 0) {
                const container = document.createElement('div');
                container.className = 'json-node';
                
                if (obj === null) {
                    container.innerHTML = `${key ? `<span class="json-key">"${key}"</span>: ` : ''}<span class="json-null">null</span>`;
                } else if (typeof obj === 'string') {
                    let displayString = obj;
                    if (!preserveEscapeCheckbox.checked) {
                        // 转换Unicode转义序列为实际字符
                        displayString = obj.replace(/\\u([0-9a-fA-F]{4})/g, function(match, code) {
                            return String.fromCharCode(parseInt(code, 16));
                        });
                    }
                    container.innerHTML = `${key ? `<span class="json-key">"${key}"</span>: ` : ''}<span class="json-string">"${escapeHtml(displayString)}"</span>`;
                } else if (typeof obj === 'number') {
                    container.innerHTML = `${key ? `<span class="json-key">"${key}"</span>: ` : ''}<span class="json-number">${obj}</span>`;
                } else if (typeof obj === 'boolean') {
                    container.innerHTML = `${key ? `<span class="json-key">"${key}"</span>: ` : ''}<span class="json-boolean">${obj}</span>`;
                } else if (Array.isArray(obj)) {
                    const line = document.createElement('div');
                    line.className = 'json-line';
                    
                    const content = document.createElement('div');
                    content.className = 'json-content';
                    
                    const toggleBtn = document.createElement('button');
                    toggleBtn.className = 'toggle-btn expanded';
                    toggleBtn.setAttribute('data-expanded', 'true');
                    // Pass obj.length to handleToggleClick
                    toggleBtn.setAttribute('onclick', `handleToggleClick(this, 'array', ${obj.length})`);
                    
                    const header = document.createElement('span');
                    header.className = 'json-header-text'; // Add a class to the header span
                    header.innerHTML = `${key ? `<span class="json-key">"${key}"</span>: ` : ''}<span class="json-bracket">[</span>`;
                    
                    const headerWithBtn = document.createElement('div');
                    headerWithBtn.appendChild(toggleBtn); // Move toggleBtn before header
                    headerWithBtn.appendChild(header);
                    
                    const body = document.createElement('div');
                    body.className = 'json-body';
                    
                    obj.forEach((item, index) => {
                        const itemNode = createJsonTree(item, null, level + 1);
                        if (index < obj.length - 1) {
                            itemNode.innerHTML += '<span class="json-comma">,</span>';
                        }
                        body.appendChild(itemNode);
                    });
                    
                    const footer = document.createElement('div');
                    footer.innerHTML = '<span class="json-bracket">]</span>';
                    
                    content.appendChild(headerWithBtn);
                    content.appendChild(body);
                    content.appendChild(footer);
                    
                    line.appendChild(content);
                    container.appendChild(line);
                    
                    // Event listener removed, logic moved to handleToggleClick
                    
                } else if (typeof obj === 'object') {
                    const line = document.createElement('div');
                    line.className = 'json-line';
                    
                    const content = document.createElement('div');
                    content.className = 'json-content';
                    
                    const toggleBtn = document.createElement('button');
                    toggleBtn.className = 'toggle-btn expanded';
                    toggleBtn.setAttribute('data-expanded', 'true');
                    // Pass keys.length to handleToggleClick
                    const objectKeysLength = Object.keys(obj).length;
                    toggleBtn.setAttribute('onclick', `handleToggleClick(this, 'object', ${objectKeysLength})`);
                    
                    const header = document.createElement('span');
                    header.className = 'json-header-text'; // Add a class to the header span
                    header.innerHTML = `${key ? `<span class="json-key">"${key}"</span>: ` : ''}<span class="json-bracket">{</span>`;
                    
                    const headerWithBtn = document.createElement('div');
                    headerWithBtn.appendChild(toggleBtn); // Move toggleBtn before header
                    headerWithBtn.appendChild(header);
                    
                    const body = document.createElement('div');
                    body.className = 'json-body';
                    
                    const keys = Object.keys(obj);
                    keys.forEach((objKey, index) => {
                        const itemNode = createJsonTree(obj[objKey], objKey, level + 1);
                        if (index < keys.length - 1) {
                            itemNode.innerHTML += '<span class="json-comma">,</span>';
                        }
                        body.appendChild(itemNode);
                    });
                    
                    const footer = document.createElement('div');
                    footer.innerHTML = '<span class="json-bracket">}</span>';
                    
                    content.appendChild(headerWithBtn);
                    content.appendChild(body);
                    content.appendChild(footer);
                    
                    line.appendChild(content);
                    container.appendChild(line);
                    
                    // Event listener removed, logic moved to handleToggleClick
                }
                
                return container;
            }
            
            // HTML转义函数
            function escapeHtml(text) {
                const div = document.createElement('div');
                div.textContent = text;
                return div.innerHTML;
            }
            
            // 格式化JSON
            function formatJSON() {
                const inputValue = jsonInput.value.trim();
                
                errorMessage.textContent = '';
                jsonOutput.innerHTML = '';
                
                if (!inputValue) {
                    errorMessage.textContent = '请输入JSON数据';
                    return;
                }
                
                try {
                    let processedInput = inputValue;
                    if (preserveEscapeCheckbox.checked) {
                        // 在解析前，将所有 \uXXXX 形式的转义序列替换为 \\uXXXX，
                        // 这样 JSON.parse 就不会将其转换为实际字符，而是保留为字符串字面量。
                        // 确保不会重复转义已经转义过的 \\uXXXX
                        processedInput = inputValue.replace(/\\u([0-9a-fA-F]{4})/g, (match, p1) => {
                            // 检查是否已经是 \\uXXXX 形式，如果是则不处理
                            if (match.startsWith('\\\\u')) {
                                return match;
                            }
                            return `\\${match}`;
                        });

                        let hasDoubleEscape = false;
                        processedInput = inputValue.replace(/\\\\u([0-9a-fA-F]{4})/g, (match) => {
                            // 已经是 \\uXXXX 形式，直接跳过不处理
                            hasDoubleEscape = true;
                            return match;
                        });
                        
                        if (!hasDoubleEscape) {
                            processedInput = processedInput.replace(/\\u([0-9a-fA-F]{4})/g, (match) => {
                                // 是 \uXXXX 形式，转换为 \\uXXXX
                                return `\\${match}`;
                            });
                        }
                    }
                    const parsedJSON = JSON.parse(processedInput.replace(/^"|"$/g, ''));
                    const tree = createJsonTree(parsedJSON);
                    jsonOutput.appendChild(tree);
                    
                    // 格式化成功后，将格式化的结果复制到输入框中
                    let formattedJSON;
                    if (preserveEscapeCheckbox.checked) {
                        formattedJSON = JSON.stringify(parsedJSON, null, 4).replace(/\\\\u/g, '\\u');
                    } else {
                        formattedJSON = JSON.stringify(parsedJSON, null, 4);
                    }
                    jsonInput.value = formattedJSON;
                } catch (error) {
                    errorMessage.textContent = `JSON格式错误: ${error.message}`;
                }
            }
            

            
            // 复制功能
            function copyToClipboard() {
                let inputValue = jsonInput.value.trim();
                if (!inputValue) {
                    return;
                }
                
                try {
                    let formattedJSON;
                    
                    if (preserveEscapeCheckbox.checked) {
                        // 保留转义，不转换Unicode字符
                        // 先处理已经是 \\u 形式的，保持不变
                        // 然后处理 \u 形式的，转换为 \\u
                        let hasDoubleEscape = false;
                        inputValue = inputValue.replace(/\\\\u([0-9a-fA-F]{4})/g, (match) => {
                            // 已经是 \\uXXXX 形式，直接跳过不处理
                            hasDoubleEscape = true;
                            return match;
                        });
                        
                        if (!hasDoubleEscape) {
                            inputValue = inputValue.replace(/\\u([0-9a-fA-F]{4})/g, (match) => {
                                // 是 \uXXXX 形式，转换为 \\uXXXX
                                return `\\${match}`;
                            });
                        }
                        
                    }
                    
                    
                    const parsedJSON = JSON.parse(inputValue);
                    // 转换Unicode字符
                    formattedJSON = JSON.stringify(parsedJSON, null, 4).replace(/\\\\u/g, '\\u');
                    
                    navigator.clipboard.writeText(formattedJSON).then(function() {
                        showNotification(copyNotification);
                    }).catch(function() {
                        console.error('复制失败');
                    });
                } catch (error) {
                    console.error('JSON格式错误，无法复制');
                }
            }
            
            // 显示通知
            function showNotification(notification) {
                notification.classList.add('show');
                setTimeout(() => {
                    notification.classList.remove('show');
                }, 2000);
            }
            
            // 清空输入
            function clearInput() {
                jsonInput.value = '';
                jsonOutput.innerHTML = '';
                errorMessage.textContent = '';
            }
            
            // 事件监听器
            formatBtn.addEventListener('click', formatJSON);
            clearBtn.addEventListener('click', clearInput);
            copyBtn.addEventListener('click', copyToClipboard);
            preserveEscapeCheckbox.addEventListener('change', formatJSON);

            
            // 监听输入框粘贴事件，自动触发格式化
            jsonInput.addEventListener('paste', function(e) {
                // 使用setTimeout确保粘贴的内容已经插入到输入框中
                setTimeout(function() {
                    if (jsonInput.value.trim()) {
                        formatJSON();
                    }
                }, 10);
            });
            
            // 键盘快捷键
            document.addEventListener('keydown', function(e) {
                if (e.ctrlKey && e.key === 'Enter') {
                    formatJSON();
                } else if (e.ctrlKey && e.key === 'k') {
                    e.preventDefault();
                    clearInput();
                }
            });
        });
        
        // 百度统计
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?3615c6485313357fe26e486bf42d9ec2";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
    </script>
</body>
</html>